#include "daemon.h"
#include "log.h"
#include <iostream>

using namespace std ; 

Log * pLog = NULL ;

void dRoutine ( void * pParm )
{
	while (true)
	{
	pLog->writeLog ( "Hello\n" ) ;
	sleep ( 1 ) ;

	}

}
int main ( ) 
{
	pLog = new Log ( );
	
	Daemon myDaemon ( "whq-Daemon", dRoutine, pLog ) ;
	
	pLog->writeLog ("", "%s started....\n", myDaemon.getName() ) ;

	myDaemon.init() ;
	myDaemon.start(NULL) ;

	delete pLog ;

	return 0 ;
}
